home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / app / BaseApplication.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  17.9 KB  |  698 lines

  1. package com.extensibility.app;
  2.  
  3. import com.extensibility.app.plugin.URIResourcePlugin;
  4. import com.extensibility.app.web.WebPost;
  5. import com.extensibility.plugin.PluginRegistry;
  6. import com.extensibility.plugin.api.ApplicationAccess;
  7. import com.extensibility.rock.AltGrPatch;
  8. import com.extensibility.rock.Platform;
  9. import com.extensibility.rock.RDialog;
  10. import com.extensibility.util.Debug;
  11. import com.extensibility.util.Security;
  12. import com.extensibility.xml.URI;
  13. import com.extensibility.xml.URIFileScheme;
  14. import com.extensibility.xml.URIStringScheme;
  15. import com.extensibility.xml.URIUrlScheme;
  16. import com.extensibility.xml.URIUrnScheme;
  17. import com.extensibility.xml.URIxschemaScheme;
  18. import java.awt.Component;
  19. import java.awt.Dialog;
  20. import java.awt.Font;
  21. import java.awt.Frame;
  22. import java.awt.Window;
  23. import java.awt.event.ActionEvent;
  24. import java.io.File;
  25. import java.io.FileOutputStream;
  26. import java.io.IOException;
  27. import java.io.PrintStream;
  28. import java.io.Writer;
  29. import java.net.URL;
  30. import java.util.Calendar;
  31. import java.util.Date;
  32. import java.util.Enumeration;
  33. import java.util.EventObject;
  34. import java.util.GregorianCalendar;
  35. import java.util.Hashtable;
  36. import java.util.Properties;
  37. import java.util.Vector;
  38. import javax.swing.JFrame;
  39. import javax.swing.JOptionPane;
  40. import javax.swing.UIManager;
  41.  
  42. public abstract class BaseApplication implements Platform.Application {
  43.    static final String PRINT_TEMPLATE = "_print_template";
  44.    protected static BaseApplication oneAndOnly;
  45.    // $FF: renamed from: ui com.extensibility.app.UI
  46.    static UI field_0;
  47.    protected Security registration;
  48.    private ApplicationPreferences prefs;
  49.    protected Vector listeners = new Vector();
  50.    static File homePath;
  51.    static final String REREGISTER = "REREGISTER";
  52.    static final String OFFLINE = "OFFLINE";
  53.    static final String OFFLINE_30DAY = "OFFLINE_30DAY";
  54.    private ApplicationAccess pluginAppAccess = new 1((BaseApplication)null);
  55.    BaseAction showHideToolbarAction;
  56.  
  57.    public BaseApplication() {
  58.       new AltGrPatch();
  59.       oneAndOnly = this;
  60.    }
  61.  
  62.    public static BaseApplication getApplication() {
  63.       return oneAndOnly;
  64.    }
  65.  
  66.    public static String getPreference(String var0) {
  67.       return getApplication().prefs.getProperty(var0);
  68.    }
  69.  
  70.    public static ApplicationPreferences getPreferences() {
  71.       return getApplication().prefs;
  72.    }
  73.  
  74.    public static String getPreference(String var0, int var1) {
  75.       return getApplication().prefs.getProperty(String.valueOf(var0).concat(String.valueOf(var1)));
  76.    }
  77.  
  78.    public static UI getUI() {
  79.       return field_0;
  80.    }
  81.  
  82.    public static boolean isDebug() {
  83.       if (getPreferences() != null) {
  84.          return getPreferences().getDebugLevel() > 0;
  85.       } else {
  86.          return true;
  87.       }
  88.    }
  89.  
  90.    public static int getDebugLevel() {
  91.       return getPreferences() != null ? getPreferences().getDebugLevel() : 2;
  92.    }
  93.  
  94.    public static File getHomePath() {
  95.       if (homePath != null) {
  96.          return homePath;
  97.       } else {
  98.          String var0 = System.getProperty("java.class.path");
  99.  
  100.          while(var0 != null) {
  101.             int var2 = var0.indexOf(System.getProperty("path.separator"));
  102.             String var1;
  103.             if (var2 >= 0) {
  104.                var1 = var0.substring(0, var2);
  105.                var0 = var0.substring(var2 + 1);
  106.             } else {
  107.                var1 = var0;
  108.                var0 = null;
  109.             }
  110.  
  111.             if (var1.length() != 0) {
  112.                File var3 = new File(var1);
  113.                if (var3.isDirectory()) {
  114.                   if ((new File(var1, String.valueOf(Class.forName("com.extensibility.app.BaseApplication").getName().replace('.', File.separatorChar)).concat(String.valueOf(".class")))).exists()) {
  115.                      homePath = new File(var3.getParent());
  116.                      break;
  117.                   }
  118.                } else if (var3.getName().equalsIgnoreCase(String.valueOf(getApplication().getAbbr()).concat(String.valueOf(".jar")))) {
  119.                   String var4 = var3.getParent();
  120.                   if (var4 == null) {
  121.                      var4 = System.getProperty("user.dir");
  122.                   }
  123.  
  124.                   homePath = new File(var4);
  125.                   break;
  126.                }
  127.             }
  128.          }
  129.  
  130.          Debug.assert(homePath != null, String.valueOf(String.valueOf(String.valueOf(String.valueOf("Unable to locate home path within ").concat(String.valueOf(System.getProperty("java.class.path")))).concat(String.valueOf(". Looked for: "))).concat(String.valueOf(getApplication().getAbbr()))).concat(String.valueOf(".jar")));
  131.          return homePath;
  132.       }
  133.    }
  134.  
  135.    public void reregister() {
  136.       String var1 = (String)this.prefs.get("CAB");
  137.       this.prefs.put("CAB", "REREGISTER");
  138.       this.register();
  139.       if (this.prefs.get("CAB").equals("REREGISTER")) {
  140.          this.prefs.put("CAB", var1);
  141.       }
  142.  
  143.    }
  144.  
  145.    public static Date getExpiration() {
  146.       GregorianCalendar var0 = getApplication().registration.getExpirationDate();
  147.       return var0 == null ? null : ((Calendar)var0).getTime();
  148.    }
  149.  
  150.    private void register() {
  151.       String var1 = this.prefs.getProperty("ESB");
  152.       String var2 = this.prefs.getProperty("KKB");
  153.       String var3 = this.prefs.getProperty("CAB");
  154.       String var4 = this.prefs.getProperty("EMC");
  155.       String var5 = this.prefs.getProperty("PHC");
  156.       Object var6 = null;
  157.       Object var7 = null;
  158.       short var8 = 999;
  159.       if (var3 != null && var3.equals("REREGISTER")) {
  160.          var8 = 3;
  161.          var3 = "";
  162.       } else if (var3 != null && var3.equals("OFFLINE")) {
  163.          var8 = 4;
  164.          var3 = "";
  165.       } else if (var3 != null && var3.equals("OFFLINE_30DAY")) {
  166.          var8 = 6;
  167.          var3 = "";
  168.       } else if (var1 != null && var1.length() != 0 && var2 != null && var2.length() != 0 && var4 != null && var4.length() != 0 && var5 != null && var5.length() != 0) {
  169.          this.registration = Security.createRegCode(this.getRegVersion(), var1, var2, var3);
  170.          if (!this.registration.isValid()) {
  171.             var8 = 2;
  172.          } else if (this.registration.isExpired()) {
  173.             var8 = 1;
  174.          } else if (this.registration.isLaunchLimited() && this.prefs.getLaunchesLeft() == 0) {
  175.             var8 = 5;
  176.             var3 = "";
  177.          }
  178.       } else {
  179.          var8 = 0;
  180.       }
  181.  
  182.       if (var8 != 999) {
  183.          Frame var19 = new Frame();
  184.          RegDialog var18 = new RegDialog(var19, var8, var1, var2, var3, var4, var5);
  185.          Desktop.splashCleanup();
  186.          ((Dialog)var18).show();
  187.          if (var18.userCanceled()) {
  188.             return;
  189.          }
  190.  
  191.          this.prefs.put("ESB", var18.getName());
  192.          var1 = var18.getName();
  193.          this.prefs.put("KKB", var18.getOrg());
  194.          var2 = var18.getOrg();
  195.          this.prefs.put("CAB", var18.getSN());
  196.          var3 = var18.getSN();
  197.          this.prefs.put("EMC", var18.getEmail());
  198.          var4 = var18.getEmail();
  199.          this.prefs.put("PHC", var18.getPhone());
  200.          var5 = var18.getPhone();
  201.          ((Window)var18).dispose();
  202.          var19.dispose();
  203.          this.registration = Security.createRegCode(this.getRegVersion(), var1, var2, var3);
  204.          if (this.registration.isValid()) {
  205.             this.prefs.put("RGS", "0");
  206.          }
  207.  
  208.          if (isLaunchLimited()) {
  209.             this.prefs.initTrialLaunchesLeft();
  210.          }
  211.  
  212.          try {
  213.             this.prefs.save();
  214.          } catch (IOException var12) {
  215.             DialogFactory.showException((Component)null, 120, var12);
  216.          }
  217.       } else {
  218.          String var9 = this.prefs.getProperty("RGS");
  219.          if (var9 != null && var9.equals("0")) {
  220.             Hashtable var10 = new Hashtable();
  221.             this.setupRegistrationInfo(this.prefs, var10);
  222.             WebPost var11 = new WebPost();
  223.             var11.init(UI.getString("webregistration.webaddress"), var10, this.prefs);
  224.             (new Thread(var11)).start();
  225.          }
  226.       }
  227.  
  228.    }
  229.  
  230.    protected void setupRegistrationInfo(ApplicationPreferences var1, Hashtable var2) {
  231.       String var3 = ((Properties)var1).getProperty("ESB");
  232.       String var4 = ((Properties)var1).getProperty("KKB");
  233.       String var5 = ((Properties)var1).getProperty("CAB");
  234.       String var6 = ((Properties)var1).getProperty("EMC");
  235.       String var7 = ((Properties)var1).getProperty("PHC");
  236.       String var8 = ((Properties)var1).getProperty("OEM");
  237.       var2.put("xmlname", var3 == null ? "" : var3);
  238.       var2.put("xmlorg", var4 == null ? "" : var4);
  239.       var2.put("xmlsn", var5 == null ? "" : var5);
  240.       var2.put("xmlemail", var6 == null ? "" : var6);
  241.       var2.put("xmlph", var7 == null ? "" : var7);
  242.       var2.put("xmlproduct", this.getAbbr());
  243.       var2.put("xmlversion", this.getVersion());
  244.       if (var8 != null && !var8.equals("")) {
  245.          var2.put("xmloem", var8);
  246.       }
  247.  
  248.    }
  249.  
  250.    public void openDocumentList(String[] var1) {
  251.       for(int var2 = 0; var2 < var1.length; ++var2) {
  252.          if (!var1[var2].equals("-quiet")) {
  253.             if (var1[var2].charAt(0) == '"' && var1[var2].charAt(var1[var2].length() - 1) == '"') {
  254.                var1[var2] = var1[var2].substring(1, var1[var2].length() - 1);
  255.             }
  256.  
  257.             this.openDocument(new File(var1[var2]));
  258.          }
  259.       }
  260.  
  261.    }
  262.  
  263.    public void doArgs(String[] var1) {
  264.       if (var1 != null && var1.length > 0 && var1[0].length() > 0) {
  265.          Desktop.createSplash();
  266.          Desktop.createWelcome(false);
  267.          this.openDocumentList(var1);
  268.       } else if (getPreferences().getShowWelcome()) {
  269.          Desktop.createWelcome(true);
  270.          this.preflight();
  271.       } else {
  272.          Desktop.createSplash();
  273.          Desktop.createWelcome(false);
  274.          this.newDocument((EventObject)null);
  275.       }
  276.  
  277.       this.fireApplicationStarted();
  278.    }
  279.  
  280.    protected String[] getSaveTypes() {
  281.       return this.getOpenTypes();
  282.    }
  283.  
  284.    public abstract byte getRegVersion();
  285.  
  286.    protected abstract String[] getOpenTypes();
  287.  
  288.    public abstract BaseDocument createNewDocument(EventObject var1);
  289.  
  290.    public abstract BaseDocument createNewDocument(URI var1);
  291.  
  292.    protected abstract UI createUI();
  293.  
  294.    protected abstract Class getMainWindowClass();
  295.  
  296.    protected abstract BaseWindow createNewWindow(BaseDocument var1);
  297.  
  298.    protected abstract ApplicationPreferences createPreferences();
  299.  
  300.    protected abstract String getAbbr();
  301.  
  302.    public abstract String getVersion();
  303.  
  304.    public RDialog createPreferencesDialog(JFrame var1) {
  305.       return new PreferencesDialog(var1, getPreferences());
  306.    }
  307.  
  308.    public abstract JFrame createWelcome();
  309.  
  310.    public abstract RDialog createPrintDialog(Frame var1);
  311.  
  312.    public void startup() throws Exception {
  313.       field_0 = this.createUI();
  314.       field_0.initResources();
  315.       Platform.initialize(this);
  316.       this.prefs = this.createPreferences();
  317.       this.prefs.readInitial(new File(getHomePath(), String.valueOf(this.getAbbr()).concat(String.valueOf("_Preferences"))));
  318.       Font var1 = this.prefs.getAppFont();
  319.       if (var1 != null) {
  320.          UI.setAppFont(var1);
  321.       }
  322.  
  323.       var1 = this.prefs.getDocFont();
  324.       if (var1 != null) {
  325.          UI.setDocFont(var1);
  326.       }
  327.  
  328.       var1 = this.prefs.getSrcFont();
  329.       if (var1 != null) {
  330.          UI.setSrcFont(var1);
  331.       }
  332.  
  333.       try {
  334.          String var2 = this.prefs.getLookAndFeel();
  335.          UIManager.setLookAndFeel(var2);
  336.       } catch (Exception var3) {
  337.       }
  338.  
  339.       Debug.setCatcher(this.createCatcher());
  340.       this.doPluginRegistration();
  341.       this.register();
  342.       if (getDebugLevel() > 1) {
  343.          System.setOut(new PrintStream(new FileOutputStream(new File("console-out.txt"))));
  344.          System.setErr(new PrintStream(new FileOutputStream(new File("console-err.txt"))));
  345.       }
  346.  
  347.       if (this.registration.isLaunchLimited()) {
  348.          this.prefs.updateLaunchesLeft(this.prefs.getLaunchesLeft() - 1);
  349.       }
  350.  
  351.    }
  352.  
  353.    protected void doPluginRegistration() {
  354.       String var1 = UI.getString("plugin.folder");
  355.       if (var1.startsWith("#MISSING")) {
  356.          var1 = "plugins";
  357.       }
  358.  
  359.       File var2 = new File(getHomePath(), var1);
  360.       PluginRegistry var3 = PluginRegistry.getRegistry();
  361.       var3.setAppAccess(this.pluginAppAccess);
  362.       var3.registerPluginsInFolder(var2);
  363.       URIResourcePlugin.registerPlugin(var3);
  364.       URIFileScheme.registerPlugin(var3);
  365.       URIStringScheme.registerPlugin(var3);
  366.       URIUrlScheme.registerPlugin(var3);
  367.       URIUrnScheme.registerPlugin(var3);
  368.       URIxschemaScheme.registerPlugin(var3);
  369.       URI.registerSchemes();
  370.    }
  371.  
  372.    protected Debug.Catcher createCatcher() {
  373.       return new 2((BaseApplication)null);
  374.    }
  375.  
  376.    public void quit() {
  377.       this.exitApplication((EventObject)null);
  378.    }
  379.  
  380.    public void openAboutWindow() {
  381.       Desktop.createAboutWindow();
  382.    }
  383.  
  384.    public void printDocument(File var1) {
  385.    }
  386.  
  387.    public void exitApplication(EventObject var1) {
  388.       Vector var2 = Desktop.getWindows();
  389.  
  390.       for(int var3 = var2.size() - 1; var3 >= 0; --var3) {
  391.          BaseWindow var4 = (BaseWindow)var2.elementAt(var3);
  392.          if (!var4.getDocument().isOkToClose(var4)) {
  393.             return;
  394.          }
  395.       }
  396.  
  397.       for(int var8 = var2.size() - 1; var8 >= 0; --var8) {
  398.          BaseWindow var5 = (BaseWindow)var2.elementAt(var8);
  399.          ((Frame)var5).dispose();
  400.       }
  401.  
  402.       try {
  403.          this.prefs.save();
  404.       } catch (IOException var6) {
  405.          DialogFactory.showException((Component)null, 108, var6);
  406.       } catch (Throwable var7) {
  407.          Debug.assert(false, String.valueOf("Got a non io error exiting application: ").concat(String.valueOf(var7)));
  408.       }
  409.  
  410.       this.fireApplicationExited();
  411.       System.exit(0);
  412.    }
  413.  
  414.    private void preflight() {
  415.    }
  416.  
  417.    public static boolean isLaunchLimited() {
  418.       return getApplication().registration.isLaunchLimited();
  419.    }
  420.  
  421.    public static int getLaunchesLeft() {
  422.       return getApplication().prefs.getLaunchesLeft();
  423.    }
  424.  
  425.    public boolean openDocumentURL(ActionEvent var1) {
  426.       String[] var2 = this.getOpenTypes();
  427.       String var3 = getPreferences().getOpenFromBase();
  428.       URI var4 = null;
  429.       if (var3 != null) {
  430.          var4 = new URI((URI)null, var3);
  431.       }
  432.  
  433.       URI var5 = DialogFactory.openURI(Desktop.getDialogParent(var1), var4, var2);
  434.       if (var5 == null) {
  435.          return false;
  436.       } else {
  437.          this.openDocument(var5);
  438.          return true;
  439.       }
  440.    }
  441.  
  442.    public boolean saveDocumentTo(ActionEvent var1, BaseDocument var2) {
  443.       Object var3 = null;
  444.       String var4 = getPreferences().getSaveToBase();
  445.       URI var5 = var2.getURI();
  446.       String var6 = var5.getFullName();
  447.       if (var6.length() < 0 || var4 != null && var4.length() != 0 && var5.getScheme().equals("file")) {
  448.          String var7 = var2.getName();
  449.          if (var4 == null) {
  450.             var4 = var7;
  451.          } else {
  452.             if (!var4.endsWith("/")) {
  453.                var4 = String.valueOf(var4).concat(String.valueOf("/"));
  454.             }
  455.  
  456.             var4 = String.valueOf(var4).concat(String.valueOf(var7));
  457.          }
  458.       } else {
  459.          var4 = var6;
  460.       }
  461.  
  462.       URI var13 = new URI((URI)null, var4);
  463.       URI var8 = DialogFactory.saveURI(Desktop.getDialogParent(var1), var13, (String[])var3);
  464.       if (var8 == null) {
  465.          return false;
  466.       } else if (var8.exists() && !DialogFactory.showConfirm((Component)null, UI.getString("stop.uri.exists", var8.getFullName()), UI.getString("dialog.replace.title"))) {
  467.          return false;
  468.       } else {
  469.          try {
  470.             Writer var9 = var2.createWriter(var8);
  471.             var2.write(var9);
  472.             var9.close();
  473.             return true;
  474.          } catch (Exception var11) {
  475.             DialogFactory.showException((Component)null, 103, var11, var8.getShortName());
  476.             boolean var10 = false;
  477.             return var10;
  478.          }
  479.       }
  480.    }
  481.  
  482.    public BaseDocument newDocument(EventObject var1) {
  483.       BaseDocument var2 = this.createNewDocument(var1);
  484.  
  485.       try {
  486.          BaseWindow var3 = this.getMainWindow(var2);
  487.          ((Component)var3).setVisible(true);
  488.       } catch (Exception var5) {
  489.          String var4 = Platform.mapNewlinesForTextArea(Debug.getStackTrace(var5));
  490.          JOptionPane.showMessageDialog(new JFrame(), var4);
  491.          Desktop.ensureWindow();
  492.       }
  493.  
  494.       return var2;
  495.    }
  496.  
  497.    public boolean openDocument(URI var1) {
  498.       BaseDocument var2 = Desktop.getDocument(var1);
  499.       if (var2 != null) {
  500.          DialogFactory.stop((Component)null, UI.getString("stop.already.open", var1.getShortName()));
  501.          Desktop.activateDocument(var2);
  502.          return true;
  503.       } else {
  504.          BaseDocument var3 = this.createNewDocument(var1);
  505.  
  506.          try {
  507.             var3.read(var1);
  508.             this.updateFileLists(var1);
  509.             this.getMainWindow(var3);
  510.             this.fireDocumentOpened(var1);
  511.             boolean var4 = true;
  512.             return var4;
  513.          } catch (Exception var6) {
  514.             DialogFactory.showException((Component)null, 102, var6);
  515.             boolean var5 = false;
  516.             return var5;
  517.          }
  518.       }
  519.    }
  520.  
  521.    public BaseWindow getMainWindow(BaseDocument var1) {
  522.       BaseWindow var2 = var1.getWindow(this.getMainWindowClass());
  523.       if (var2 != null) {
  524.          ((Window)var2).toFront();
  525.          return var2;
  526.       } else {
  527.          var2 = this.createNewWindow(var1);
  528.          Desktop.positionNewWindow(var2);
  529.          var2.initialize(getPreferences());
  530.          Desktop.showNewWindow(var2, true);
  531.          return var2;
  532.       }
  533.    }
  534.  
  535.    public void createAnotherWindow(BaseDocument var1) {
  536.       BaseWindow var2 = this.createNewWindow(var1);
  537.       Desktop.positionNewWindow(var2);
  538.       var2.initialize((ApplicationPreferences)null);
  539.       Desktop.showNewWindow(var2, false);
  540.    }
  541.  
  542.    public boolean openDocument(ActionEvent var1) {
  543.       File var2 = DialogFactory.askFile(Desktop.getDialogParent(var1), UI.getString("dialog.open.schema"), this.getOpenTypes());
  544.       return var2 == null ? false : this.openDocument(new URI(var2));
  545.    }
  546.  
  547.    public void saveNotify(URI var1, BaseDocument var2) {
  548.       Enumeration var3 = Desktop.getDocuments();
  549.  
  550.       while(var3.hasMoreElements()) {
  551.          BaseDocument var4 = (BaseDocument)var3.nextElement();
  552.          if (var4 != var2) {
  553.             var4.saveNotify(var1);
  554.          }
  555.       }
  556.  
  557.       this.fireDocumentSaved(var1);
  558.    }
  559.  
  560.    public void updateFileLists(URI var1) {
  561.       this.prefs.updateRecent(var1);
  562.       this.updateRecentMenu();
  563.       this.updateWindowMenu();
  564.    }
  565.  
  566.    public void removeFromRecent(URI var1) {
  567.       this.prefs.removeFromRecent(var1);
  568.       this.updateRecentMenu();
  569.    }
  570.  
  571.    private void updateWindowMenu() {
  572.       Enumeration var1 = Desktop.getWindows().elements();
  573.  
  574.       while(var1.hasMoreElements()) {
  575.          BaseWindow var2 = (BaseWindow)var1.nextElement();
  576.          var2.fillWindowsMenu();
  577.       }
  578.  
  579.    }
  580.  
  581.    private void updateRecentMenu() {
  582.       Enumeration var1 = Desktop.getWindows().elements();
  583.  
  584.       while(var1.hasMoreElements()) {
  585.          BaseWindow var2 = (BaseWindow)var1.nextElement();
  586.          var2.updateRecentMenuItems();
  587.       }
  588.  
  589.    }
  590.  
  591.    public void updateNewSubMenu() {
  592.       Enumeration var1 = Desktop.getWindows().elements();
  593.  
  594.       while(var1.hasMoreElements()) {
  595.          BaseWindow var2 = (BaseWindow)var1.nextElement();
  596.          String var3 = getPreferences().getDefaultFileType();
  597.          var2.updateNewSubMenuItems(UI.getFileTypeName(var3));
  598.       }
  599.  
  600.    }
  601.  
  602.    public BaseAction createToolbarAction() {
  603.       if (this.showHideToolbarAction == null) {
  604.          this.showHideToolbarAction = new 3(this, "item.tb");
  605.          this.showHideToolbarAction.setSelected(this.prefs.getToolbarView() == 1);
  606.       }
  607.  
  608.       return this.showHideToolbarAction;
  609.    }
  610.  
  611.    private void updateToolBarView(int var1) {
  612.       this.prefs.updateToolBarView(var1);
  613.       Enumeration var2 = Desktop.getWindows().elements();
  614.  
  615.       while(var2.hasMoreElements()) {
  616.          BaseWindow var3 = (BaseWindow)var2.nextElement();
  617.          var3.updateToolBarView();
  618.       }
  619.  
  620.    }
  621.  
  622.    public boolean openDocument(URL var1) {
  623.       return this.openDocument(new URI(var1));
  624.    }
  625.  
  626.    public boolean openDocument(File var1) {
  627.       return this.openDocument(new URI(var1));
  628.    }
  629.  
  630.    public void addApplicationListener(ApplicationListener var1) {
  631.       this.listeners.addElement(var1);
  632.    }
  633.  
  634.    public void removeApplicationListener(ApplicationListener var1) {
  635.       this.listeners.removeElement(var1);
  636.    }
  637.  
  638.    public void fireApplicationStarted() {
  639.       Enumeration var1 = this.listeners.elements();
  640.  
  641.       while(var1.hasMoreElements()) {
  642.          ApplicationListener var2 = (ApplicationListener)var1.nextElement();
  643.          var2.applicationStarted();
  644.       }
  645.  
  646.    }
  647.  
  648.    public void fireApplicationExited() {
  649.       Enumeration var1 = this.listeners.elements();
  650.  
  651.       while(var1.hasMoreElements()) {
  652.          ApplicationListener var2 = (ApplicationListener)var1.nextElement();
  653.          var2.applicationExited();
  654.       }
  655.  
  656.    }
  657.  
  658.    public void fireDocumentOpened(URI var1) {
  659.       Enumeration var2 = this.listeners.elements();
  660.  
  661.       while(var2.hasMoreElements()) {
  662.          ApplicationListener var3 = (ApplicationListener)var2.nextElement();
  663.          var3.documentOpened(var1);
  664.       }
  665.  
  666.    }
  667.  
  668.    public void fireDocumentSaved(URI var1) {
  669.       Enumeration var2 = this.listeners.elements();
  670.  
  671.       while(var2.hasMoreElements()) {
  672.          ApplicationListener var3 = (ApplicationListener)var2.nextElement();
  673.          var3.documentSaved(var1);
  674.       }
  675.  
  676.    }
  677.  
  678.    public void fireDocumentClosed(URI var1) {
  679.       Enumeration var2 = this.listeners.elements();
  680.  
  681.       while(var2.hasMoreElements()) {
  682.          ApplicationListener var3 = (ApplicationListener)var2.nextElement();
  683.          var3.documentClosed(var1);
  684.       }
  685.  
  686.    }
  687.  
  688.    // $FF: synthetic method
  689.    static void access$1000171(BaseApplication var0, int var1) {
  690.       var0.updateToolBarView(var1);
  691.    }
  692.  
  693.    // $FF: synthetic method
  694.    static ApplicationPreferences access$1000071(BaseApplication var0) {
  695.       return var0.prefs;
  696.    }
  697. }
  698.